package com.ruoyi.washer.mqtt;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

@RestController
@RequestMapping("/mqtt")
public class WebhookController {

    /*
        mqtt连接的时候触发
     */
    @PostMapping(value = "/get/connected/Value")
    public void getConnectedValue(@RequestBody() HashMap<String, Object> params){
        Iterator iter = params.keySet().iterator();//
        while (iter.hasNext()) {
            System.out.println("key:"+iter.next()+"value:"+params.get(iter.next()));
        }

    }
}
